package com.example.mrzhou.lvmm.model.impl;

import com.example.mrzhou.lvmm.api.DesService;
import com.example.mrzhou.lvmm.api.RetroManager;
import com.example.mrzhou.lvmm.entity.destination.Destination;
import com.example.mrzhou.lvmm.model.IDesModel;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Mr.zhou on 2016/10/29.
 */

public class DesModelImpl implements IDesModel {

    @Override
    public void getDesData(Map<String, String> map, Subscriber<Destination> subscriber) {
        RetroManager.getInstance(DesService.BASE_URL).getDesService().getDesData(map)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }
}
